{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "source": [
    "class A(object):\r\n",
    "    a = 0\r\n",
    "\r\n",
    "    def __init__(self):\r\n",
    "        self.b = 1\r\n",
    "        self.c = 2\r\n",
    "        self.name = \"Tom\"\r\n",
    "\r\n",
    "\r\n",
    "aa = A()\r\n",
    "# 返回类内部所有属性和方法对应的字典\r\n",
    "print(A.__dict__)\r\n",
    "# 返回实例属性和值组成的字典\r\n",
    "print(aa.__dict__)"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "{'__module__': '__main__', 'a': 0, '__init__': <function A.__init__ at 0x00000249C675B158>, '__dict__': <attribute '__dict__' of 'A' objects>, '__weakref__': <attribute '__weakref__' of 'A' objects>, '__doc__': None}\n",
      "{'b': 1, 'c': 2, 'name': 'Tom'}\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [],
   "outputs": [],
   "metadata": {}
  }
 ],
 "metadata": {
  "orig_nbformat": 4,
  "language_info": {
   "name": "python",
   "version": "3.6.4",
   "mimetype": "text/x-python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "pygments_lexer": "ipython3",
   "nbconvert_exporter": "python",
   "file_extension": ".py"
  },
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.6.4 64-bit ('base': conda)"
  },
  "interpreter": {
   "hash": "a8f61be024eba58adef938c9aa1e29e02cb3dece83a5348b1a2dafd16a070453"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}